perm filename FNTCHR.MAI[UP,DOC] blob sn#456388 filedate 1979-07-06 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00006 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	Introduction
C00004 00003	Format for .FNT files [Can be skipped without anything bad happening to you]
C00007 00004	Format for .CHR files
C00011 00005	Using FNTCHR and CHRFNT
C00013 00006	A sample glyph definition
C00015 ENDMK
C⊗;
Introduction
------------


  FNTCHR and CHRFNT are complementary programs that transfer fonts between
the usual font format (i.e., which usually have the filename extension .FNT)
and a new "charfile" format (with conventional filename extension .CHR).
Char files can be modified easily using the TV editor.  Fonts can also be
designed using the editor, and then compiled into .FNT files.


		************			************   
		*          *	   CHRFNT	*          *
		*          * ←-----------------	*          *
		*   .FNT   *			*   .CHR   *
		*   file   *			*   file   *
		*          * -----------------→	*          *
		*          *	   FNTCHR	*          *
		************			************   




Please send any comments or bugs found to MAI.

Format for .FNT files [Can be skipped without anything bad happening to you]
---------------------

  A fairly complete description of the format of font files can be
found in

  "Find a Font", edited by Les Earnest, SAIL Operating Note 74 
    [May, 1976], pages 46-48.

Some small items have been left out of the description or since changed,
including the following:

1.  The first 128 words of the file contain pointers to the word number
    where the corresponding glyph definition begins.  This means that the
    glyph attached to Ascii code  n  has its pointer in word  n  of this
    directory, even though the code is repeated later in the glyph
    definition.

2.  Kern sizes may be negative as well as zero or positive.  This allows
    more compact bit packing in the block word count.  Since the left kern
    is specified in 9 bits, the leftmost bit is the sign bit, and kerns are
    limited in size by  -256 ≤ left kern ≤ 255.

3.  Since kerns can be negative, there are three kinds of glyph "widths":
    the logical width and raster width as described in "Find a Font", and
    the "internal width" defined by the width (in pixels) of the smallest
    box containing all black pixels in the glyph.  It is this "internal
    width" that determines how the bit raster is packed:  if the internal
    width (and not the raster width, and NOT the logical width as specified
    in "Find a Font"!!) is 36 or less, than the data are packed into words
    such that an ILDB gets the next scan line.  Otherwise, each scan line
    starts at the first available word boundary.

Format for .CHR files
---------------------


  A .CHR file (or "charfile") is a standard TV editor-formatted file.

	Page		Contents
	----		--------
	1		Page directory
	2		Font description, font statistics
			  (height, width, baseline position, etc.)
	3 ...		Individual glyph definitions (one per page)


Font Description

  
  This should nominally indicate where the font is from, its author, and so
on.  The line following this description should contain only a ⊗ sign as an
"end of description" marker.  The remainder of the page will be ignored:
FNTCHR will write out some of the font's measurements here, but these numbers
are for the convenience of the user, and are not used by either FNTCHR or
CHRFNT.


Glyph Description


  The remaining pages will include one glyph specification per page.  
The first line gives the character used to identify the glyph, specified
either by its octal Ascii code (e.g., '101) or the character itself
(e.g., "A").  The remaining lines of the page picture the glyph, showing
black pixels as *, white pixels as space, kern and baselines by dots (.).
The following conventions are used:

1.  Exactly two columns must have more than one dot.  These denote the
    left and right kern lines.  Since kern lines occur between pixels,
    the "logical part" of the glyph is shown in  between these columns.
    A * which occurs in one of these columns is then just outside the
    logical part, situated either in the rightmost part of the left kern,
    or the leftmost part of the right kern. When two characters are typeset
    next to each other, the right-dot-column of the left character is
    positioned one column after the left-dot-column of the right character.

2.  No more than one row can have more than two dots in it.  This row 
    sits on the baseline.  Again, like the kern lines, the baseline occurs
    between rows.  Therefore, it is shown on the last row above the
    baseline.  If no row has more than two dots in it, then it is assumed
    that the last row on the page sits immediately above the baseline.

Using FNTCHR and CHRFNT
-----------------------


  FNTCHR inputs a .FNT file and outputs a .CHR file.  The defaults on
the extension and location of the input are .FNT and [XGP,SYS].  Defaults
on the output are .CHR and the user's directory.

  CHRFNT inputs a .CHR file and outputs a .FNT file.  The defaults on
the extensions are .CHR and .FNT; both are assumed to be in the user's
directory.  Before exiting, CHRFNT will prompt the user for some global
font statistics: overall height of the font (in pixels), and its logical
height above the baseline.  In each case the defaults are the smallest
possible positive integers compatible with the glyph definitions.


			*****************
			*               *
			*               *
			*    N O T E    *
			*               *
			*               *
			*****************


  Output from FNTCHR cannot be fed directly to CHRFNT !!  The .CHR file
must be reformatted using the editor to paginate it and prepare a
directory.

A sample glyph definition
-------------------------
                           {↓ Right kern begins here
"w"	= '167                ↓ and ends here}
   .                        .       ↑
   .←----logical width-----→.       |
   .                        .       |
   .                        .       |
   .                        . rows from top
   .←------raster width-------→     |
   .                        .       |
   .     ←----internal width--→     |
   .                        .       ↓
   .      **       **       **      ↑ ←------ databegin
   .     ****     ****     ****     |
   .     ****    *****    *****     |
   .     ****   ******   *****      |
   .     ****   ******   ****       |
   .     ****  *******  *****       |
   .     *******************. data row count
   .      ******** ******** .       |
   .      ******** ******** .       |
   .      *******  *******  .       |
   .      ******   ******   .       |
   .      ******   ******   .       |
   .      *****    *****    .       |
...........****.....****..........  |
   .        **       **     .       ↓ ←------ dataend


Try using FNTCHR on your favorite font in [XGP,SYS] to see more....